Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a workflow that runs Verus on each task #25

Merged
merged 29 commits into from
Dec 2, 2024
Merged

Add a workflow that runs Verus on each task #25

merged 29 commits into from
Dec 2, 2024

Conversation

parno
Copy link
Contributor

@parno parno commented Nov 25, 2024

No description provided.

@parno parno requested a review from jaybosamiya November 25, 2024 21:59
@parno
Copy link
Contributor Author

parno commented Nov 25, 2024

@jaybosamiya It was harder than I expected to figure out how retrieve the latest released version of Verus. I ended up using a custom action that I cobbled together, but it left me wondering if there was a simpler way.

@parno
Copy link
Contributor Author

parno commented Nov 26, 2024

Also, when I push to this PR, it appears to run the jobs twice, which seems sub-optimal.

@parno
Copy link
Contributor Author

parno commented Nov 26, 2024

@mmcloughlin suggested the following script, which looks much simpler and easier to maintain, so I'm planning to move to that when there's time.

#!/usr/bin/env bash

REPO="verus-lang/verus"

# Determine tag of latest release.
function latest_release_tag() {
    gh release list \
        --repo "${REPO}" \
        --limit 1 \
        --json tagName \
        --template '{{range .}}{{.tagName}}{{end}}'
}

tag=$(latest_release_tag)

# Download the x86 Linux package.
gh release download \
    --repo "${REPO}" \
    "${tag}" \
    --pattern '*-x86-linux.zip' \
    --output "verus.zip"

@jaybosamiya
Copy link
Member

Yep, would suggest using something similar to what @mmcloughlin suggested. A few alternative ways to get that URL:

curl -s https://api.github.com/repos/verus-lang/verus/releases | \
  awk -F'"' '/download/{print $4}' | grep x86-linux
curl -s https://api.github.com/repos/verus-lang/verus/releases | \
  jq -r '.[].assets.[].browser_download_url' | grep x86-linux

The running-twice happens because of the push, pull_request; iirc, the push makes it run on the branch's commit itself, and the pull_request runs on a hypothetical merge between the main branch and the branch. My suggestion would be to remove the push portion and/or restrict push to just being on main via a branches filter.

@parno
Copy link
Contributor Author

parno commented Dec 2, 2024

With some fiddling, I got a non-JS version working. Thanks for all of the suggestions!

@parno parno merged commit b9e3e44 into main Dec 2, 2024
3 checks passed
@parno parno deleted the ci-setup branch December 2, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants